﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using UserDefinedForms.Entities;
using UserDefinedForms.Business;

namespace UserDefinedForms.UDFRunning
{
    public partial class Running : Form
    {
        public Running()
        {
            InitializeComponent();
            InitializeComboBoxValue();
        }
        private void InitializeComboBoxValue()
        {
            // Load summary orders from database, add them to combobox 1
            OrderService os = new OrderService();
            TList<Order> orderList = os.GetAll();
            foreach (Order o in orderList)
            {
                if (o.OrderType == Constant.ORDER_TYPE_SUM_ORDER)
                {
                    cbbSummaryOrderID.Items.Add(o.OrderId);
                }
            }

            // Load summary forms from database, add them to combobox 2
            DesignFormService fs = new DesignFormService();
            TList<DesignForm> formList = fs.GetAll();
            foreach (DesignForm f in formList)
            {
                if (f.FormType == Constant.FORM_TYPE_SUM_FORM)
                {
                    cbbSummaryFormID.Items.Add(f.FormId);
                }
            }
        }
    }
}
